* ==============================================================================
*
* Date:	Summer 2024
* Paper: Climate shocks, regional favoritism and trust in leaders: Insights from droughts in Africa
*
* This is the master do-file
*
* Dataset used: tr_rep.dta
*
* ==============================================================================

version 17.0
clear
clear matrix

* Directory
* global dir "PATH"
global PATH "[Insert local filepath here]" /* Change to your local filepath */
cd $PATH
global OUTPATH "[Insert local filepath here]" /* Change to local output filepath */

* Global macros

* Control sets
global xcont "age age2 male i.ed_ord"

global fecont "urban ea_svc_a ea_svc_b ea_svc_c ea_fac_a ea_fac_b ea_fac_c ea_fac_d ea_fac_e ea_sec_a ea_sec_b grs0 grsem0 grsl cropland_d ln_alt ln_dist_cit ln_alt_sd ln_dist_bor ln_dist_coa ln_dist_riv ln_dist_roa i.year i.month i.uid1 countrytrend*"

* Clustering level
global clustervar "cidgrid01"

* Main sample
global zsample "if precision_code<=3"

**# Bookmark #3

**** Tables

* Summary statistics
run summary 		/* Table 1. Summary Statistics */
run frequencies 	/* Table 2. Frequency of Trust Responses */

* Main regressions tables 
run baseline 		/* Table 3. Drought Conditions and Trust in Leaders */
run severity		/* Table 4. Drought Condition Severity and Trust in Leaders */
run caplbr			/* Table 5. Capital Region and Leader Birth Region */


**** Online Supplement to "Weather Shocks, Regional Favoritism and Trust in Leaders: Insights from Droughts in Africa"

** Supplementary A. Robustness tests
run altdrought			/* Table S1. Alternative Indicators for Drought Conditions	*/
run splits				/* Table S2. Subsamples */
run intermediates_full	/* Table S3a. Intermediary Outcomes in full sample */
run intermediates_woprescap	/* Table S3b. Intermediary Outcomes without Birth Leader Regions or Capital Regions */
run intermediates_presregion /* Table S3c. Intermediary Outcomes in Birth Leader Region */
run intermediates_capregion /* Table S3d. Intermediary Outcomes in Capital Region */
run bindeps			/* Table S4. Binary Indicators of Trust */
run preccodes		/* Table S5. Baseline Estimation with Varying Precision Codes */
run controls		/* Table S6. Baseline Estimation with Control Variables Omitted */
run controls_ilcv	/* Table S7. Baseline Estimation with Individual-Level Control Variables Omitted */
run baseline_poltrust /* Table S8. Drought Conditions and Political Trust Indicators */
run gridfe			/* Table S9. Baseline and Binary but with 0.5 Degree Grid Cell Fixed Effects */
run spatcorrse		/* Table S10. Spatial HAC Standard Errors. This model contains by necessity information about the latitude of respondents' enumeration area. Because of proprietory agreement with Aid Data, users will need to contact the corresponding author who will guide them on how to access full data and replication for this specific model. */
run placebo			/* Table S11. Placebo Tests Using Temporal and Spatial Reversal of SPEI Values */

** Supplementary B. Alternative Data on Drought Disasters
run emdat			/* Table Sb1. Reported Drought Disasters From EMDAT/GDIS */



